package cn.yhp.chatgpt.data.types.exception;

import cn.yhp.chatgpt.data.types.common.Constants;

/**
 * @author yhp
 * @description
 * @date 2024/2/2
 */
public class ChatGPTException extends RuntimeException{

    /**
     * 异常码
     */
    private String code;

    /**
     * 异常信息
     */
    private String message;

    public ChatGPTException(String message){
        super(message);
        this.message=message;
    }

    public ChatGPTException(Constants.ResponseCode responseCode){
        super(responseCode.getInfo());
        this.code=responseCode.getCode();
        this.message=responseCode.getInfo();
    }

    public ChatGPTException(String code, String message) {
        this.code = code;
        this.message = message;
    }
}
